<!DOCTYPE html>
<html lang="en">
<head>
<title>News</title>
<meta charset="utf-8">
<link rel="stylesheet" href="css/reset.css" type="text/css" media="all">
<link rel="stylesheet" href="css/layout.css" type="text/css" media="all">
<link rel="stylesheet" href="css/style.css" type="text/css" media="all">
<script type="text/javascript" src="js/jquery-1.6.js" ></script>
<script type="text/javascript" src="js/cufon-yui.js"></script>
<script type="text/javascript" src="js/cufon-replace.js"></script>
<script type="text/javascript" src="js/Swis721_Cn_BT_400.font.js"></script>
<script type="text/javascript" src="js/Swis721_Cn_BT_700.font.js"></script>
<script type="text/javascript" src="js/tabs.js"></script>

  <!--[if lt IE 9]>
  	<script type="text/javascript" src="js/html5.js"></script>
	<style type="text/css">
		.bg{ behavior: url(js/PIE.htc); }
	</style>
  <![endif]-->
	<!--[if lt IE 7]>
		<div style=' clear: both; text-align:center; position: relative;'>
			<a href="http://www.microsoft.com/windows/internet-explorer/default.aspx?ocid=ie6_countdown_bannercode"><img src="http://www.theie6countdown.com/images/upgrade.jpg" border="0"  alt="" /></a>
		</div>
	<![endif]-->

</head>

<body id="page2">
	<div class="body1">
	<div class="body2">
	<div class="body5">
		<div class="main">
<!-- header -->
			<header>
				<div class="wrapper">
				<h1><a href="index.html" id="logo">Progress Business Company</a></h1>
				<nav>
					<ul id="menu">
						<li id="nav1"><a href="index.html">Home<span>Welcome!</span></a></li>
						<li id="nav2" class="active"><a href="ssa.html">SSA<span>Fresh</span></a></li>
						<li id="nav3"><a href="nmt.html">NMT<span>for you</span></a></li>
						<li id="nav4"><a href="wsn.html">WSN<span>The best</span></a></li>
						<li id="nav5"><a href="Contacts.html">Contacts<span>Our Address</span></a></li>
					</ul>
				</nav>
				</div>
			</header><div class="ic">More Website Templates  at TemplateMonster.com!</div>
<!-- header end-->
		</div>
	</div>
	</div>
	</div>
	<div class="body3">
		<div class="main">
<!-- content -->
			<article id="content">


<?php



@$submit = $_POST['submit'];


//form data
@$firstname =strip_tags($_POST['firstname']);
@$lastname =strip_tags($_POST['lastname']);
@$username = strtolower(strip_tags($_POST['username']));
@$password =strip_tags($_POST['password']);
@$repeatpassword =strip_tags($_POST['repeatpassword']);
@$date= date ("Y-m-d");


if ($submit)

{

//open database


$connect = mysql_connect("localhost","root","bytewalla5");
mysql_select_db("ssa"); //select database

$namecheck = mysql_query("SELECT username FROM users WHERE username='$username'");

$count = mysql_num_rows($namecheck);

if ($count!=0)

{

die("Username already taken!");

}

//check for exitance

if ($firstname&&$username&&$password&&$repeatpassword)


{


 if($password==$repeatpassword)
 
 {
   
   
//check char length of username and fullname


if( strlen($username)>25||strlen($firstname)>25)
{
  echo "length of username or fullname is too long";
}
else
{

 //check password lenght

 if(strlen($password)>25||strlen($password)<6)
 {
 echo "password must be between 6 and 25 characters";
 }

  else
  
  {
  //register the user
  
  //encrypt password
$password= md5($password);
$repeatpassword=md5($repeatpassword);



$queryreg = mysql_query("

 INSERT INTO users VALUES ('','$firstname','$lastname','$username','$password','$date')


");
die ("you have been registered!. <a href='ssa.html'>Return to login</a>");




  }


}




 }
 
 else
 
 echo "your passwords do not match";




}
else
echo "please all fields <b>all </b> fields";


}



?>

				<div class="wrapper tabs">
     <section class="col1">
						<h2 class="under">Register</h2>
						<form id="ContactForm" action='register1.php' method="post">
						<div>
							<div  class="wrapper">
								<span>First Name:</span>
								<input type="text" name='firstname' class="input" >
							</div>
							<div  class="wrapper">
								<span>Last Name:</span>
								<input type="text" name='lastname' class="input" >
							</div>
							<div  class="wrapper">
								<span>User Name:</span>
								<input type="text" name='username' class="input" >
							</div>
							<div  class="wrapper">
								<span>Password:</span>
								<input type="password" name='password' class="input" >
							</div>
							<div  class="wrapper">
								<span>Re-type Password:</span>
								<input type="password" name='repeatpassword' class="input" >
							</div>
                                                         <div id="button"> <input type='submit' name='submit'>  </div> 
                                                     <!--    <a href="#" onClick="document.getElementById('ContactForm').submit()">Submit</a>  -->
							<a href="#" onClick="document.getElementById('ContactForm').reset()">Clear</a>
						</div>
                                   	</form>
					</section>


				</div>

			</article>
		</div>
	</div>
	<div class="body4">
		<div class="main">
			<article id="content2">
				<div class="wrapper">
					<section class="col3">
						<h4>Why Us?</h4>
						<ul class="list1">
							<li><a href="#">Lorem ipsum dolor sit</a></li>
							<li><a href="#">Dmet, consectetur</a></li>
							<li><a href="#">Adipisicing elit eiusmod </a></li>
							<li><a href="#">Tempor incididunt ut</a></li>
						</ul>
					</section>
					<section class="col3 pad_left2">
						<h4>Address</h4>
						<ul class="address">
							<li><span>Country:</span>Sweden</li>
							<li><span>City:</span>Stockholm</li>
							<li><span>Phone:</span></li>
							<li><span>Email:</span><a href="mailto:">mail@bytewalla.com</a></li>
						</ul>
					</section>
					<section class="col3 pad_left2">
						<h4>Follow Us</h4>
						<ul id="icons">
							<li><a href="#"><img src="images/icon1.jpg" alt="">Facebook</a></li>
							<li><a href="#"><img src="images/icon2.jpg" alt="">Twitter</a></li>
							<li><a href="#"><img src="images/icon3.jpg" alt="">LinkedIn</a></li>
							<li><a href="#"><img src="images/icon4.jpg" alt="">Delicious</a></li>
						</ul>
					</section>
					<section class="col2 right">
						<h4>Newsletter</h4>
						<form id="newsletter" method="post">
							<div>
								<div class="wrapper">
									<input class="input" type="text" value="Type Your Email Here"  onblur="if(this.value=='') this.value='Type Your Email Here'" onFocus="if(this.value =='Type Your Email Here' ) this.value=''" >
								</div>
								<a href="#" class="button" onClick="document.getElementById('newsletter').submit()">Subscribe</a>
							</div>
						</form>
					</section>
				</div>
			</article>
<!-- content end -->
		</div>
	</div>
		<div class="main">
<!-- footer -->
			<footer>
				<a rel="nofollow" href="http://www.templatemonster.com/" target="_blank">Website Template</a> by TemplateMonster.com<br>
				<a href="http://www.templates.com/product/3d-models/" target="_blank">3D Models</a> provided by Templates.com
			</footer>
<!-- footer end -->
		</div>
<script type="text/javascript"> Cufon.now(); </script>
<script>
	$(document).ready(function() {
		tabs.init();
	})
</script>
</body>
</html>